<?php
/**
 * ============================================================================
 * 版权所有 2008-2011 多多网络，并保留所有权利。
 * 网站地址: http://soft.duoduo123.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
session_start();
error_reporting(0);
include_once 'comm/config.php';
include_once 'comm/checkpostandget.php';
include_once 'comm/page.class.php';

$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=40;
$frmnum=($page-1)*$pagesize;
$mall_name=$_GET['mall'];
$catid=$_GET['catid'];

$sql="select * from ".$BIAOTOU."malltype order by sort asc";
$rs_malltype=mysql_query($sql);
$thiscatname="全部商城";
$i=0;
while ($row = mysql_fetch_array($rs_malltype)) {
	$rsmalltype[$i]['typecode']=$row['typecode'];
	$rsmalltype[$i]['typename']=$row['typename'];
	if($catid==$row['typecode']){
		$thiscatname=$row['typename'];
	}
	$i++;
}

if($catid==''){
    $where_catid='';
}
elseif($catid>0){
     $where_catid="and catid = '$catid'";
}

$sql="select count(*) as totalnum from ".$BIAOTOU."mall where `name` like '%$mall_name%' $where_catid";
$rsnum = mysql_query($sql);
$rownum = mysql_fetch_array($rsnum);
$total=$rownum["totalnum"];

//查找店铺数据库
$sql="select * from ".$BIAOTOU."mall where `name` like '%$mall_name%' $where_catid order by sort desc limit $frmnum,$pagesize";
$rs=mysql_query($sql);

$tag="malllist";
include_once 'comm/wjt.php';
//引入模版文件
include 'template/'.MOBAN.'/malllist.tpl.php';
mysql_close($cfg_link);
?>